package com.ruoyi.slope.device.dataDownload.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.slope.device.dataDownload.mapper.SlopeFileTaskMapper;
import com.ruoyi.slope.device.dataDownload.domain.SlopeFileTask;
import com.ruoyi.slope.device.dataDownload.service.ISlopeFileTaskService;

/**
 * 数据下载Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-25
 */
@Service
public class SlopeFileTaskServiceImpl implements ISlopeFileTaskService 
{
    @Autowired
    private SlopeFileTaskMapper slopeFileTaskMapper;

    /**
     * 查询数据下载
     * 
     * @param id 数据下载主键
     * @return 数据下载
     */
    @Override
    public SlopeFileTask selectSlopeFileTaskById(Long id)
    {
        return slopeFileTaskMapper.selectSlopeFileTaskById(id);
    }

    /**
     * 查询数据下载列表
     * 
     * @param slopeFileTask 数据下载
     * @return 数据下载
     */
    @DataScope(deptAlias = "s")
    @Override
    public List<SlopeFileTask> selectSlopeFileTaskList(SlopeFileTask slopeFileTask)
    {
        return slopeFileTaskMapper.selectSlopeFileTaskList(slopeFileTask);
    }

    /**
     * 新增数据下载
     * 
     * @param slopeFileTask 数据下载
     * @return 结果
     */
    @Override
    public int insertSlopeFileTask(SlopeFileTask slopeFileTask)
    {
        slopeFileTask.setCreateTime(DateUtils.getNowDate());
        return slopeFileTaskMapper.insertSlopeFileTask(slopeFileTask);
    }

    /**
     * 修改数据下载
     * 
     * @param slopeFileTask 数据下载
     * @return 结果
     */
    @Override
    public int updateSlopeFileTask(SlopeFileTask slopeFileTask)
    {
        slopeFileTask.setUpdateTime(DateUtils.getNowDate());
        return slopeFileTaskMapper.updateSlopeFileTask(slopeFileTask);
    }

    /**
     * 批量删除数据下载
     * 
     * @param ids 需要删除的数据下载主键
     * @return 结果
     */
    @Override
    public int deleteSlopeFileTaskByIds(Long[] ids)
    {
        return slopeFileTaskMapper.deleteSlopeFileTaskByIds(ids);
    }

    /**
     * 删除数据下载信息
     * 
     * @param id 数据下载主键
     * @return 结果
     */
    @Override
    public int deleteSlopeFileTaskById(Long id)
    {
        return slopeFileTaskMapper.deleteSlopeFileTaskById(id);
    }
}
